package com.yic.module.mes.controller.admin.plan.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;

import static com.yic.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 生产计划 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class PlanBaseVO {

    @Schema(description = "计划单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "计划单号不能为空")
    private String code;

    @Schema(description = "工单类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "工单类型不能为空")
    private Integer type;

    @Schema(description = "产品通用信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16289")
    @NotNull(message = "产品通用信息ID不能为空")
    private Long itemId;

    @Schema(description = "产品生产信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16289")
    @NotNull(message = "产品生产信息ID不能为空")
    private Long itemProduceId;

    @Schema(description = "工厂", requiredMode = Schema.RequiredMode.REQUIRED, example = "14658")
    @NotNull(message = "工厂不能为空")
    private Long factoryId;

    @Schema(description = "生产车间", requiredMode = Schema.RequiredMode.REQUIRED, example = "14658")
    @NotNull(message = "生产车间不能为空")
    private Long workshopId;

    @Schema(description = "是否紧急", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否紧急不能为空")
    private Integer emergent;

    @Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String batchNo;

    @Schema(description = "备注", example = "你说的对")
    private String remark;

    @Schema(description = "预计产量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "预计产量不能为空")
    private BigDecimal planAmount;

    @Schema(description = "计划开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "计划开始时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime planStartTime;

    @Schema(description = "计划完成时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "计划完成时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime planCompleteTime;

    @Schema(description = "erp工作中心", example = "你说的对")
    @NotNull(message = "erp工作中心不能为空")
    private String erpCenterCode;

    @Schema(description = "erp仓库", example = "你说的对")
    @NotNull(message = "erp仓库不能为空")
    private String erpWarehouseCode;

    @Schema(description = "erp批号", example = "你说的对")
    @NotNull(message = "erp批号不能为空")
    private String erpItemLotCode;

}
